<template>
    <div>
        <h1>1---登录页面</h1>
        <p>账号：<input type="text" v-model="name"></p>
        <p>密码：<input type="text" v-model="password"></p>
        <p><button @click="denglu">登录</button></p>

    </div>
</template>

<script>
import axios from 'axios'
export default {
    data() {
        return {
            name:'',
            password:''

        }
    },
    methods: {
        denglu(){
            let fdata = new FormData()
            fdata.append('name',this.name)
            fdata.append('password',this.password)

            axios({
                url:'http://127.0.0.1:8000/app01/user/',
                method:'post',
                data:fdata
            }).then(res=>{
                console.log(res.data)
            })
        }

    },
    created() {

    }
}
</script>

<style scoped>

</style>
